{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.0*x/(x**2 - 1)**0.5\n",
      "1.00503781525921\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import sympy as sp\n",
    "\n",
    "# 微分\n",
    "x = sp.symbols('x')\n",
    "y = (x ** 2 - 1) ** 0.5\n",
    "dy_dx = sp.diff(y, x)\n",
    "print(dy_dx)\n",
    "print(dy_dx.subs({x:10}))"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
  },
  "kernelspec": {
   "display_name": "Python 3.7.3 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
